﻿@{
    ViewBag.Title = "缓存管理";
}
@model System.Data.DataTable
<div class="pageheader">
    <div class="page-bar">
        <ul class="page-breadcrumb">
            <li><a href="javascript:;"><i class="iconfont icon-home1"></i> 首页</a> </li>
            <li><a href="javascript:;">系统管理</a> </li>
            <li><a href="javascript:;">缓存管理</a> </li>
        </ul>
    </div>
</div>
<div class="layui-fluid">
    <div class="layui-card layui-tab">
        <div class="layui-card-body table-tool-mini">
            <div class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-btn-group">
                            <a class="layui-btn icon-btn layui-btn-normal layui-btn-sm" href="javascript:location.reload();"><i class="iconfont icon-build"></i><span> 刷新</span></a>
                            <a data-type="btnDelete" class="layui-btn icon-btn layui-btn-normal layui-btn-sm"><i class="iconfont icon-delete"></i><span> 删除缓存</span></a>
                            <a data-type="btnDelAll" class="layui-btn icon-btn layui-btn-normal layui-btn-sm"><i class="iconfont icon-delete"></i><span> 清除全部</span></a>
                        </div>
                    </div>
                </div>
            </div>
            <table class="layui-table" lay-data="{page:true, id:'ltable'}" lay-filter="ltable">
                <thead>
                    <tr>
                        <th lay-data="{checkbox:true}"></th>
                        <th lay-data="{field:'i'}">序号</th>
                        <th lay-data="{field:'name'}">缓存键值</th>
                    </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
@section Scripts{
    <script type="text/javascript">
        layui.use(['table', 'cmswh'], function () {
            var table = layui.table, form = layui.form, cmswh = layui.cmswh, $ = layui.jquery;

            cmswh.dataBind('CacheList','',false);
            var active = {
                btnDelete: function () {
                    cmswh.batOperate('CaCheDelete', 'name', "是否删除指定页面缓存？");
                },
                btnDelAll: function () {
                    cmswh.request('CaCheDelAll', 'POST');
                }
            };
            $('.layui-inline .layui-btn').on('click', function () {
                var type = $(this).data('type');
                active[type] ? active[type].call(this) : '';
            });
        });
    </script>
}